package cn.ywang.framework;

/**
 * @Auther: BeatificWang
 * @Date: 2018/11/17 16:46
 */
public class SqlSession {
	private Configuration configuration;
	private Executor executor;

	public SqlSession(Configuration configuration, Executor executor) {
		this.configuration = configuration;
		this.executor = executor;
	}

	public <T> T getMapper(Class<T> clazz) {
		return this.configuration.getMapper(clazz, this);

	}

	public <T> T selectOne(String statement, String parameter) {

		return this.executor.query(statement, parameter);
	}
}
